﻿<local:DocumentBase x:Class="WPFExcelReport.MVTVU17X"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework" 
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    Loaded="Window_Loaded" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    FontSize="14" 
                    Background="White"  
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwFS05" Source="{Binding Path=ICC_FS05,Source={StaticResource SetData}}" />        
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
            <RowDefinition Height="*" MinHeight="300"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
            Name="expLog" ExpandDirection="Down" IsExpanded="True">
            <StackPanel>               
                    <WrapPanel Width="1023" Height="38">
                        <Label Content="款号："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtARTICLE" Width="170" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="1"
                         Focusable="True" KeyUp="txtART_KeyUp" Background="YellowGreen" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />
                        <Label Content="年份："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtCOLL" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="2"
                             KeyUp="txtART_KeyUp" Background="Pink" MaxLength="4" FontSize="18" Foreground="#FF141111" Height="33" />
                        <Label Content="波段："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtREASON" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="3"
                             KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="18" Foreground="#FF141111" Height="33" />
                        
                </WrapPanel>
                <WrapPanel Width="1023">
                    <Label Content="大类："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                    <TextBox Name="txtPRDGRP" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="4"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="18" Foreground="#FF141111" Height="33" />
                    <Label Content="小类："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                    <TextBox Name="txtARTGRP" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="5"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="4" FontSize="18" Foreground="#FF141111" Height="33" />
                    <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="6" IsDefault="True" TabIndex="13">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <Button Content="EXCEL" Margin="20,0,0,0" Name="btnReport" Width="47" Click="btnReport_Click" TabIndex="7" />

                </WrapPanel>
            </StackPanel>
        </Expander> 
        <FlowDocumentScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"  >
                <FlowDocument> 
                    <Paragraph>
                    <DataGrid  AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwFS05}}"  
                              HeadersVisibility="Column"
                              x:Name="MasterDg"    
                              Height="Auto" FontSize="14" FontFamily ="Times New Roman"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" >
                        <!-- , Converter={StaticResource ResourceKey=gb2312}-->
      <!-- FSSART	FSABEZ	COLOR	SIZE1	MTYPE	FSSMART	WABEZ	WALOHNA	LSNAME1	USEAGE	FSSVBME	CONSUMPTION-->
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=FSSART}" Header="款号" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=FSABEZ}" Header="款号描述" Width="SizeToCells" MinWidth="70" />
                            <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="颜色对应" Width="SizeToCells" MinWidth="60" />
                            <DataGridTextColumn Binding="{Binding Path=SIZE1}" Header="尺码对应" Width="SizeToCells" MinWidth="60" />
                            <DataGridTextColumn Binding="{Binding Path=MTYPE}" Header="原料类型" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=FSSMART}" Header="原料编号" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=WABEZ}" Header="原料描述" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=WALOHNA}" Header="供应商原料名" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=LSNAME1}" Header="供应商" Width="SizeToCells" MinWidth="30" MaxWidth="100"/>
                            <DataGridTextColumn Binding="{Binding Path=USEAGE}" Header="用量" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=FSSVBME}" Header="单位" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=CONSUMPTION}" Header="损耗%" Width="SizeToHeader" MinWidth="30" />
                        </DataGrid.Columns>
                    </DataGrid > 
                    </Paragraph>
                </FlowDocument>
            </FlowDocumentScrollViewer>     
    </Grid>
</local:DocumentBase>